package com.ddwl.funds.dao;

import com.ddwl.common.dao.TkDao;
import com.ddwl.funds.dao.mapper.OrderRefundsMapper;
import com.ddwl.funds.dao.model.OrderRefunds;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 订单退款表(OrderRefunds)数据处理
 *
 * @author zach
 * @since 2020-09-24 11:42:01
 */
@Repository
public class OrderRefundsDao  extends TkDao<OrderRefundsMapper, OrderRefunds> {


    public OrderRefunds getOrderRefundsByBizRefundsNo(String bizRefundsNo){
        OrderRefunds orderRefunds = new OrderRefunds();
        orderRefunds.setBizRefundsNo(bizRefundsNo);
        return selectOne(orderRefunds);
    }

    public OrderRefunds getOrderRefundsByBizRefundsNo(String orderId,String bizRefundsNo){
        OrderRefunds orderRefunds = new OrderRefunds();
        orderRefunds.setBizRefundsNo(bizRefundsNo);
        orderRefunds.setOrderNo(orderId);
        return selectOne(orderRefunds);
    }

    /**
     * 获取订单退款信息
      * @param orderId
     * @return
     */
    public List<OrderRefunds> getOrderReFundsByOrderId(String orderId){
        OrderRefunds orderRefunds = new OrderRefunds();
        orderRefunds.setOrderNo(orderId);
        return select(orderRefunds);
    }
}